fix: default resolveChain to mainnet and read MPPX_RPC_URL env var#285
Merged
brendanjryan merged 1 commit intomainfrom Apr 2, 2026
Merged
fix: default resolveChain to mainnet and read MPPX_RPC_URL env var#285brendanjryan merged 1 commit intomainfrom
brendanjryan merged 1 commit intomainfrom
Conversation
9c75bd9 to
346bdb9
Compare
commit: |
346bdb9 to
9e1ee3d
Compare
- Add resolveRpcUrl() that consolidates RPC URL resolution: explicit flag → MPPX_RPC_URL env → RPC_URL env → undefined. Replaces 5 scattered inline patterns across cli.ts, tempo.ts, and utils.ts. - resolveChain() now uses resolveRpcUrl() internally, so env vars are always respected. Default is tempoMainnet (not testnet). - Add tests for both resolveRpcUrl and resolveChain defaults.
9e1ee3d to
d096be6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
resolveChain()insrc/cli/utils.tsdefaults totempoModerato(testnet) when no--rpc-urlflag orMPPX_RPC_URLenv var is provided. This means users must always pass--rpc-urlwith the Tempo mainnet RPC to use mainnet, even though the CLI documents that it "defaults to public RPC for chain."Additionally, the tempo plugin reads
process.env.RPC_URLbut not the documentedMPPX_RPC_URLenv var.Fix
resolveChain(): Change default fromtempoModeratototempoMainnetwhen no RPC URL is provided. This matches the pattern already used inaccount view.Tempo plugin: Read
MPPX_RPC_URLbefore falling back toRPC_URL, consistent with the documented env var name. Both env vars are supported for backward compatibility.Tests: Add
resolveChainunit tests verifying it defaults to mainnet.